<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Document</title>
</head>
<body>
   <script>
         //验证邮箱： 邮箱以这些结束.com|.cn|.sina|.net
         var ste =  prompt('请输入您的邮箱地址')
         var reg = /\.com|\.cn|\.sina|\.net/;
         // var ste = '123456789.com';
         // 检测
         var res = reg.test(ste);
         console.log(res);
         if(res){
         alert('输入正确');
      }else{
         alert('格式不对，请重新输入');
      }
   </script>
</body>
</html>